# 通过`map`函数将上述同学的`age` + 1(对原数据结构有影响, 尽量不要用lambda)
from pprint import pprint
classes1= [
    {"name": "n_1", "age": 11, "grade": "A"},
    {"name": "n_8", "age": 22, "grade": "B"},
    {"name": "n_3", "age": 55, "grade": "A"},
    {"name": "n_6", "age": 44, "grade": "A"},
    {"name": "n_5", "age": 33, "grade": "C"},
    {"name": "n_4", "age": 66, "grade": "D"},
    {"name": "n_7", "age": 77, "grade": "A"},
]
print("原始学生数据：")
pprint(classes1)

#执行整数+1
def add1(d):  #加1;参数是一个字典
    d['age']+=1

m = map(add1,classes1)#classes1中的每一个元素就是一个字典
list(m)
print("改变年龄之后：")
pprint(classes1)
